﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ExIF35
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
        }

        private void listView1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                e.Effect = DragDropEffects.Copy;
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }

        private void listView1_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                doFileProcessing(files);
            }
        }

        private void doFileProcessing(String[] files)
        {
            foreach (String file in files)
            {
                Image Img = Image.FromFile(file);
                PropertyItem Shutter = Img.GetPropertyItem(0x8822);
                String shutterspeed = Shutter.Value.ToString();

             //   PropertyItem FL = Img.GetPropertyItem(0x920A);
               // PropertyItem Aper = Img.GetPropertyItem(0x829D);
                
                //PropertyItem ISO = Img.GetPropertyItem(0x8827);

                //listView1.Items.Add(new ListViewItem(new String[] {file, FL.Value.ToString(), Aper.Value.ToString(), "Shutter.Value.ToString()", "ISO.Value.ToString()" }));
            }
        }

        private void Form4_Load(object sender, EventArgs e)
        {

        }
     }            
}
